<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib uri="/WEB-INF/tld/application.tld" prefix="app" %>

	<logic-el:present name="proximasTurmasList" scope="request">
		<table style="width:650px;height:150px">
			<tr>
				<td valign="top">
					<table style="width: 100%" class="tbDadosConsulta">
						<tr>
							<th style="width:25px"></th>
							<th style="width:120px">Data</th>
							<th>Curso</th>
							<th style="width:100px">Período</th>
							<th style="width:80px">Vagas</th>
						</tr>
						<logic-el:iterate id="bean" name="proximasTurmasList" scope="request" indexId="i">
							<tr class="linha${i%2}">
								<td style="text-align: center">
									<input type="radio" name="proximasTurmas" value="${bean.codigo}" onclick="turmaDetalhe('proximasTurmas')"/>
								</td>
								<td style="text-align: center">
									<bean:write name="bean" property="inicio" format="dd/MM"/> - 
									<bean:write name="bean" property="termino" format="dd/MM"/>
								</td>
								<td style="text-align: left">${bean.curso.nome}</td>
								<td style="text-align: center">${bean.periodo.descricao}</td>
								<td style="text-align: center">${bean.vagas}</td>
							</tr>
						</logic-el:iterate>
						<input type="hidden" name="proximasTurmas" value=""/>							
					</table>
				</td>
			</tr>
		</table>
	</logic-el:present>
	<logic-el:notPresent name="proximasTurmasList" scope="request">
		<table style="width:650px;height:70px">
			<tr>
				<td valign="top">
					<table style="width: 100%" class="tbDadosConsulta">
						<tr>
							<td>Não há próximas turmas agendadas.</td>
						</tr>				
					</table>
				</td>
			</tr>
			<tr>
				<td class="buttons" align="right" valign="bottom">	
					<a href="cadastroTurma.do?method=iniciar" class="button">
						<span>Turmas</span>
					</a>
				</td>
			</tr>
		</table>
	</logic-el:notPresent>
